<include file="Public:header" />
<script type="text/javascript">
    $(function(){
        $('#constant_id').change(function(){
            var constant_id=$('#constant_id').val();
            get_node(constant_id);
        });
        
        function get_node(constant_id){
            $.post('{:U("constant_node/get_node_option")}',
            { 'constant_id':constant_id }
            , function(data){chuli(data)}, 'html');
        }
        
        $('document').ready(function(){
            var constant_id=$('#constant_id').val();
            get_node(constant_id);
        });
        
        function chuli(data){
            $('#parentid').html('<option value="0">顶级节点</option>');
            $('#parentid').append(data);
        }
    });
</script>
<div class="handle-btns">
    <lbase:linkBtn text="{$Think.lang.RETURN_LIST}" href="{:U(MODULE_NAME.'/index')}" />
</div>
<form method='post' id="form" name="form" action="{:U(MODULE_NAME.'/insert')}" enctype="multipart/form-data">
    <table cellpadding="4" cellspacing="0" border="0" class="table-form">
        <tr>
            <th width="180">{$Think.lang.CONSTANT_NAME}</th>
            <td>
        <lbase:select options="constant_list" name="constant_id" textfield="constant_title" valuefield="id" id="constant_id" />

        </td>
        </tr>
        <tr>
            <th width="180">{$Think.lang.NAME}</th>
            <td><input type="text" class="textinput requireinput" name="name" /></td>
        </tr>
        <tr>
            <th width="180">{$Think.lang.SORT}</th>
            <td><input type="text" class="textinput" size="5" name="sort" value="10" /></td>
        </tr>
        <tr>
            <th width="180">{$Think.lang.STATUS}</th>
            <td>
                <input type="radio" name="status" value="1" checked="checked" /><span>是</span>
                <input type="radio" name="status" value="0" /><span>否</span>
            </td>
        </tr>
        <tr>
            <th width="180">{$Think.lang.REMART}</th>
            <td><input type="text" class="textinput" name="remart" value="" /></td>
        </tr>
        <tr>
            <th width="180">{$Think.lang.PARENTID}</th>
            <td>
                <select name="parentid" id="parentid">
                    <option value="0">顶级节点</option>
                </select>
            </td>
        </tr>
        <tr class="act">
            <th>&nbsp;</th>
            <td>
                <input type="submit" class="submit_btn" value="{$Think.lang.SUBMIT}" />
                <input type="reset" class="reset_btn" value="{$Think.lang.RESET}" />
            </td>
        </tr>
    </table>
</form>
<include file="Public:footer" />